import {
  request,
  post
} from '../../utils/request'

// pages/swiper/lunbo.js
Page({  
  data: {
    list: [],
    list2: [],
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

    wx.request({
        url: 'https://showme.myhope365.com/api/cms/article/open/banner/list',
        method: "POST",
        data: {
          pageNum: 1,
          pageSize: 5,
        },
        header: {
          "content-type": "application/x-www-form-urlencoded"
        },
        success: res => {
          // console.log(res)
          this.setData({
            list2: res.data.rows
          })

        }
      }),
      wx.request({
        url: 'https://showme.myhope365.com/api/cms/article/open/list',
        method: "POST",
        data: {

          pageNum: 1,
          pageSize: 10,
        },
        header: {
          "content-type": "application/x-www-form-urlencoded"
        },
        success: res => {
          // console.log(res)
          this.setData({
            list: res.data.rows
          })

        }
      })
  },
    /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    wx.setTabBarStyle({
      backgroundColor: '#fff',
    })
  },
  detail(e){
    console.log(e)
    wx.navigateTo({
      // url: '/pages/news-detail/index?id='+e.currentTarget.dataset.id,
      url: `/pages/new-detail/index?id=${e.currentTarget.dataset.id}`,
    })
  },
    // 设置分享的数据
    onShareAppMessage(options){
      return {
        title: '放飞自我',
        imageUrl: "http://dpic.tiankong.com/ik/xm/QJ8181381674.jpg?x-oss-process=style/shows"
      }
  },
})